﻿using UnityEngine;
using strange.extensions.dispatcher.eventdispatcher.api;
public class ScoreService : IScoreService 
{

	public void RequestScore(string url)
	{
		Debug.Log ("get score from " + url);
		OnReceiveScore ();
	}

	public void OnReceiveScore()
	{
		int score = Random.Range (0, 100);
		dispachter.Dispatch (ServiceEvent.RequestScore,score);
	}

	public void UpdateScore(string url , int score)
	{
		dispachter.Dispatch (ServiceEvent.UpdateScore,score);
	}

	[Inject]
	public IEventDispatcher dispachter {
		get;
		set;
	}

	
}
